package cn.edu.swu.book;

import java.util.Date;

public class Book {
    private int id;
    private String name;
    private String author;
    private double price;
    private String description;
    private Date publish;

    public Book(){}

    public Book(int id, String name, String author, double price, String description, Date publish) {
        this.setId(id);
        this.setName(name);
        this.setAuthor(author);
        this.setPrice(price);
        this.setMemo(description);
        this.setPublish(publish);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getMemo() {
        return getDescription();
    }

    public void setMemo(String description) {
        this.setDescription(this.description);
    }

    public Date getPublish() {
        return publish;
    }

    public void setPublish(Date publish) {
        this.publish = publish;
    }

    public String toString() {
        return String.format("%s, %s, %s, %s, %s, %s",
                this.getId(), this.getName(), this.getAuthor(),
                this.getPrice(), this.getMemo(), this.getPrice());
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
